﻿CREATE PROCEDURE [dbo].[yaf_topic_lock](
                @TopicID INT,
                @Locked  BIT)
AS
    BEGIN
        IF @Locked <> 0
        UPDATE yaf_Topic
        SET    Flags = Flags | 1
        WHERE  TopicID = @TopicID
        ELSE
        UPDATE yaf_Topic
        SET    Flags = Flags & ~ 1
        WHERE  TopicID = @TopicID
    END


